<?php 
namespace app\admin\validate;
use think\validate;
class AdvValidate extends Validate{
    //验证规则
    protected $rule = array(
		'ap_id'=>'require|number',
		'adv_title' => 'max:255',
		'adv_url' => 'max:255',
		'slide_sort'=>'number',
	);
    //验证失败提示信息
    protected $message = array(
		'ap_id.require'=>'广告位id不能为空',
		'ap_id.number'=>'广告位id的值必须是一个整数',
		'adv_title.max'=>'广告内容描述的值不能超过255个字符',
		'adv_url.max'=>'链接地址的值不能超过255个字符',
		'slide_sort.number'=>'幻灯片排序的值必须是一个整数',
);
    //验证场景
    protected $scene = array(
		'add'=>array('ap_id','adv_title','adv_url','adv_image','slide_sort'),
		'edit'=>array('id','ap_id','adv_title','adv_url','adv_image','slide_sort'),
	);

}